package com.sigmatrix.h5.web.controller.utils;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sigmatrix.h5.entity.FirstLevelQRCode;
import com.sigmatrix.h5.service.FirstLevelQrCodeService;
import com.sigmatrix.h5.web.BaseController;
import com.sigmatrix.h5.web.args.QueryQrCodeParamV2;

/**
 * 通过firstLevelQrCode测试常用操作
 * 
 * @author wei.wang
 *
 */
@RestController
@RequestMapping("/util/test/firstLevelQrCode")
public class TestFirstLevelQrCodeController extends BaseController {

	@Autowired
	private FirstLevelQrCodeService firstLevelQrCodeService;

	//
	@PostMapping("/select/seqnum/esecode/{esecode}")
	public FirstLevelQRCode findBySeqNum(HttpServletRequest request,@RequestBody QueryQrCodeParamV2 param, @PathVariable String esecode) {
		return firstLevelQrCodeService.findBySeqNum(param.getQrCode(),esecode);
	}
	//
	@PostMapping("/select/qrcode/esecode/{esecode}")
	public FirstLevelQRCode findByQRCode(HttpServletRequest request,@RequestBody QueryQrCodeParamV2 param, @PathVariable String esecode) {
		return firstLevelQrCodeService.findByQRCode(param.getQrCode(),esecode);
	}
	
	
}
